#include "asm.h"
#include "regdef.h"
#include "inst_test.h"

LEAF(n21_pcaddu12i_test)
    
    addi.w s0, s0 ,1
    addi.w s2, zero, 0x0
###test inst
    TEST_PCADDU12I(0xc4bde)
    TEST_PCADDU12I(0xc41f2)
    TEST_PCADDU12I(0x481a0)
    TEST_PCADDU12I(0x4a6cc)
    TEST_PCADDU12I(0xf4f80)
    TEST_PCADDU12I(0xb7ac7)
    TEST_PCADDU12I(0xb78b0)
    TEST_PCADDU12I(0x6cd28)
    TEST_PCADDU12I(0x9a597)
    TEST_PCADDU12I(0x60695)
    TEST_PCADDU12I(0xee05f)
    TEST_PCADDU12I(0x03b68)
    TEST_PCADDU12I(0x0ba4e)
    TEST_PCADDU12I(0x9b9da)
    TEST_PCADDU12I(0x26c88)
    TEST_PCADDU12I(0x26ad2)
    TEST_PCADDU12I(0x8af42)
    TEST_PCADDU12I(0x6a288)
    TEST_PCADDU12I(0x1cdc0)
    TEST_PCADDU12I(0x0bf42)
    TEST_PCADDU12I(0xdad42)
    TEST_PCADDU12I(0x2bb20)
    TEST_PCADDU12I(0x1d850)
    TEST_PCADDU12I(0x37c51)
    TEST_PCADDU12I(0x834d8)
    TEST_PCADDU12I(0x1b8ec)
    TEST_PCADDU12I(0xb86c0)
    TEST_PCADDU12I(0x9df60)
    TEST_PCADDU12I(0xe129c)
    TEST_PCADDU12I(0x59446)
    TEST_PCADDU12I(0x9e964)
    TEST_PCADDU12I(0x8f481)
    TEST_PCADDU12I(0x00d07)
    TEST_PCADDU12I(0xedd82)
    TEST_PCADDU12I(0x7f54e)
    TEST_PCADDU12I(0x1e5aa)
    TEST_PCADDU12I(0x46aa4)
    TEST_PCADDU12I(0x10144)
    TEST_PCADDU12I(0xc7109)
    TEST_PCADDU12I(0x6e200)
    TEST_PCADDU12I(0x21a7a)
    TEST_PCADDU12I(0x434e8)
    TEST_PCADDU12I(0x06737)
    TEST_PCADDU12I(0xbf198)
    TEST_PCADDU12I(0x53c20)
    TEST_PCADDU12I(0x694d2)
    TEST_PCADDU12I(0xb957a)
    TEST_PCADDU12I(0xdbb50)
    TEST_PCADDU12I(0x99e58)
    TEST_PCADDU12I(0x0f5b8)
    TEST_PCADDU12I(0x2a7b8)
    TEST_PCADDU12I(0xd345d)
    TEST_PCADDU12I(0x334f8)
    TEST_PCADDU12I(0x47bdc)
    TEST_PCADDU12I(0x14ea1)
    TEST_PCADDU12I(0x17ba4)
    TEST_PCADDU12I(0xd3229)
    TEST_PCADDU12I(0xfd046)
    TEST_PCADDU12I(0x9eeb5)
    TEST_PCADDU12I(0xf67ac)
    TEST_PCADDU12I(0xbe647)
    TEST_PCADDU12I(0x403ed)
    TEST_PCADDU12I(0x8dd34)
    TEST_PCADDU12I(0x8c734)
    TEST_PCADDU12I(0x02fb6)
    TEST_PCADDU12I(0xa7fbb)
    TEST_PCADDU12I(0xae790)
    TEST_PCADDU12I(0xa6ac0)
    TEST_PCADDU12I(0x101d0)
    TEST_PCADDU12I(0x5b014)
    TEST_PCADDU12I(0xe5b82)
    TEST_PCADDU12I(0xcf9d0)
    TEST_PCADDU12I(0x38c14)
    TEST_PCADDU12I(0xcd7f4)
    TEST_PCADDU12I(0x48f24)
    TEST_PCADDU12I(0x43643)
    TEST_PCADDU12I(0xa0b30)
    TEST_PCADDU12I(0x34c63)
    TEST_PCADDU12I(0x0cfa0)
    TEST_PCADDU12I(0x139c4)
    TEST_PCADDU12I(0xf62e8)
    TEST_PCADDU12I(0x10e58)
    TEST_PCADDU12I(0xdba72)
    TEST_PCADDU12I(0xd5c69)
    TEST_PCADDU12I(0x2bee6)
    TEST_PCADDU12I(0x361fc)
    TEST_PCADDU12I(0xbaa45)
    TEST_PCADDU12I(0x45435)
    TEST_PCADDU12I(0x3844d)
    TEST_PCADDU12I(0x50a48)
    TEST_PCADDU12I(0xc4e42)
    TEST_PCADDU12I(0xb69b2)
    TEST_PCADDU12I(0xf0db6)
    TEST_PCADDU12I(0x6765a)
    TEST_PCADDU12I(0x9dc80)
    TEST_PCADDU12I(0x64c29)
    TEST_PCADDU12I(0x11346)
    TEST_PCADDU12I(0xf1462)
    TEST_PCADDU12I(0x920c5)
    TEST_PCADDU12I(0x0c0b6)
    TEST_PCADDU12I(0x51fcd)
    TEST_PCADDU12I(0x573a0)
    TEST_PCADDU12I(0xa1b1b)
    TEST_PCADDU12I(0x78e44)
    TEST_PCADDU12I(0x0ea08)
    TEST_PCADDU12I(0x5c6b5)
    TEST_PCADDU12I(0xdb2f8)
    TEST_PCADDU12I(0xc796b)
    TEST_PCADDU12I(0x32e2e)
    TEST_PCADDU12I(0x39afc)
    TEST_PCADDU12I(0x67a54)
    TEST_PCADDU12I(0xad3a0)
    TEST_PCADDU12I(0x041ff)
    TEST_PCADDU12I(0x99052)
    TEST_PCADDU12I(0x9ea92)
    TEST_PCADDU12I(0xfe6e8)
    TEST_PCADDU12I(0x26258)
    TEST_PCADDU12I(0xd2df5)
    TEST_PCADDU12I(0x0701d)
    TEST_PCADDU12I(0x07888)
    TEST_PCADDU12I(0x88358)
    TEST_PCADDU12I(0x51b55)
    TEST_PCADDU12I(0xc2b28)
    TEST_PCADDU12I(0xccdba)
    TEST_PCADDU12I(0x6a9f0)
    TEST_PCADDU12I(0x63bba)
    TEST_PCADDU12I(0x7c0c0)
    TEST_PCADDU12I(0xdce44)
    TEST_PCADDU12I(0x08750)
    TEST_PCADDU12I(0x38c58)
    TEST_PCADDU12I(0x9f460)
    TEST_PCADDU12I(0x18e54)
    TEST_PCADDU12I(0xc8d59)
    TEST_PCADDU12I(0xf301a)
    TEST_PCADDU12I(0xd62de)
    TEST_PCADDU12I(0x6d411)
    TEST_PCADDU12I(0x0fcf6)
    TEST_PCADDU12I(0xd046c)
    TEST_PCADDU12I(0x8e198)
    TEST_PCADDU12I(0xbba48)
    TEST_PCADDU12I(0x9cc62)
    TEST_PCADDU12I(0xaf170)
    TEST_PCADDU12I(0xa510d)
    TEST_PCADDU12I(0xf36d0)
    TEST_PCADDU12I(0x16148)
    TEST_PCADDU12I(0x7e460)
    TEST_PCADDU12I(0x8b0be)
    TEST_PCADDU12I(0xd62cf)
    TEST_PCADDU12I(0x86214)
    TEST_PCADDU12I(0x704f8)
    TEST_PCADDU12I(0xb0dc0)
    TEST_PCADDU12I(0x7f7be)
    TEST_PCADDU12I(0x846b2)
    TEST_PCADDU12I(0x98a00)
    TEST_PCADDU12I(0x80ae0)
    TEST_PCADDU12I(0x82748)
    TEST_PCADDU12I(0x2b15c)
    TEST_PCADDU12I(0x6f8b7)
    TEST_PCADDU12I(0xbd9fe)
    TEST_PCADDU12I(0xe6d84)
    TEST_PCADDU12I(0x9f400)
    TEST_PCADDU12I(0x0537c)
    TEST_PCADDU12I(0xa2894)
    TEST_PCADDU12I(0xf085f)
    TEST_PCADDU12I(0xb6fd4)
    TEST_PCADDU12I(0x98612)
    TEST_PCADDU12I(0x68f5a)
    TEST_PCADDU12I(0xe7a1e)
    TEST_PCADDU12I(0x13640)
    TEST_PCADDU12I(0xb96aa)
    TEST_PCADDU12I(0x435cc)
    TEST_PCADDU12I(0x8c393)
    TEST_PCADDU12I(0xa9717)
    TEST_PCADDU12I(0x1ed59)
    TEST_PCADDU12I(0x143a8)
    TEST_PCADDU12I(0x24536)
    TEST_PCADDU12I(0xb8650)
    TEST_PCADDU12I(0xae3a0)
    TEST_PCADDU12I(0xd7e1a)
    TEST_PCADDU12I(0x465b4)
    TEST_PCADDU12I(0x81845)
    TEST_PCADDU12I(0xcedf8)
    TEST_PCADDU12I(0x30333)
    TEST_PCADDU12I(0xe6d30)
    TEST_PCADDU12I(0xa7276)
    TEST_PCADDU12I(0xa91f0)
    TEST_PCADDU12I(0x9ed79)
    TEST_PCADDU12I(0x97d84)
    TEST_PCADDU12I(0x9eaff)
    TEST_PCADDU12I(0xe9630)
    TEST_PCADDU12I(0x07795)
    TEST_PCADDU12I(0x040e0)
    TEST_PCADDU12I(0x80829)
    TEST_PCADDU12I(0xa2a44)
    TEST_PCADDU12I(0x89714)
    TEST_PCADDU12I(0xf2df2)
    TEST_PCADDU12I(0x49613)
    TEST_PCADDU12I(0xecc9e)
    TEST_PCADDU12I(0x525b7)
    TEST_PCADDU12I(0x3d8a4)
    TEST_PCADDU12I(0xdd056)
    TEST_PCADDU12I(0xf75c8)
    TEST_PCADDU12I(0x8003c)
    TEST_PCADDU12I(0xf49ba)
    TEST_PCADDU12I(0x1c550)
    TEST_PCADDU12I(0x9d018)
    TEST_PCADDU12I(0x83e80)
    TEST_PCADDU12I(0xc4138)
    TEST_PCADDU12I(0x89778)
    TEST_PCADDU12I(0xf39b0)
    TEST_PCADDU12I(0xbf48c)
    TEST_PCADDU12I(0x74434)
    TEST_PCADDU12I(0xd8800)
    TEST_PCADDU12I(0x798c0)
    TEST_PCADDU12I(0xd1ad0)
    TEST_PCADDU12I(0x8d6a0)
    TEST_PCADDU12I(0xa4c00)
    TEST_PCADDU12I(0x4da77)
    TEST_PCADDU12I(0x38680)
    TEST_PCADDU12I(0x1b71d)
    TEST_PCADDU12I(0xd4870)
    TEST_PCADDU12I(0x39385)
    TEST_PCADDU12I(0x1d9c0)
    TEST_PCADDU12I(0x36a40)
    TEST_PCADDU12I(0x88e14)
    TEST_PCADDU12I(0xf8f3f)
    TEST_PCADDU12I(0xbc4f8)
    TEST_PCADDU12I(0xfade4)
    TEST_PCADDU12I(0xc25f1)
    TEST_PCADDU12I(0x8f422)
    TEST_PCADDU12I(0x8731c)
    TEST_PCADDU12I(0x677c4)
    TEST_PCADDU12I(0x0d795)
    TEST_PCADDU12I(0xb8610)
    TEST_PCADDU12I(0xa6c16)
    TEST_PCADDU12I(0xb5124)
    TEST_PCADDU12I(0x823a4)
    TEST_PCADDU12I(0x6e4b2)
    TEST_PCADDU12I(0x9b420)
    TEST_PCADDU12I(0x0b050)
    TEST_PCADDU12I(0xb9000)
    TEST_PCADDU12I(0x743f0)
    TEST_PCADDU12I(0x3803c)
    TEST_PCADDU12I(0x46372)
    TEST_PCADDU12I(0xe38c2)
    TEST_PCADDU12I(0x0288a)
    TEST_PCADDU12I(0x38150)
    TEST_PCADDU12I(0x4b4b4)
    TEST_PCADDU12I(0xf4a7c)
    TEST_PCADDU12I(0xd8a00)
    TEST_PCADDU12I(0x876f5)
    TEST_PCADDU12I(0xe9680)
    TEST_PCADDU12I(0x92684)
    TEST_PCADDU12I(0x9b23e)
    TEST_PCADDU12I(0x16b71)
    TEST_PCADDU12I(0x79b06)
    TEST_PCADDU12I(0x914bd)
    TEST_PCADDU12I(0x075e4)
    TEST_PCADDU12I(0x4faca)
    TEST_PCADDU12I(0x851e0)
    TEST_PCADDU12I(0x94e72)
    TEST_PCADDU12I(0xe8cb8)
    TEST_PCADDU12I(0xf58d8)
    TEST_PCADDU12I(0x8e438)
    TEST_PCADDU12I(0x6303c)
    TEST_PCADDU12I(0x5119a)
    TEST_PCADDU12I(0x8e770)
    TEST_PCADDU12I(0x1ab00)
    TEST_PCADDU12I(0xc79e0)
    TEST_PCADDU12I(0x8a444)
    TEST_PCADDU12I(0xefe40)
    TEST_PCADDU12I(0xd3124)
    TEST_PCADDU12I(0x5ab64)
    TEST_PCADDU12I(0x909b0)
    TEST_PCADDU12I(0xea9ac)
    TEST_PCADDU12I(0x459b0)
    TEST_PCADDU12I(0x1e79c)
    TEST_PCADDU12I(0x41820)
    TEST_PCADDU12I(0xb0efc)
    TEST_PCADDU12I(0x41a90)
    TEST_PCADDU12I(0x662b6)
    TEST_PCADDU12I(0x035dc)
    TEST_PCADDU12I(0x668e8)
    TEST_PCADDU12I(0x60f64)
    TEST_PCADDU12I(0x3d40a)
    TEST_PCADDU12I(0xd1541)
    TEST_PCADDU12I(0xfdbe0)
    TEST_PCADDU12I(0xdd6b6)
    TEST_PCADDU12I(0xfd39c)
    TEST_PCADDU12I(0xa77e0)
    TEST_PCADDU12I(0x16a96)
    TEST_PCADDU12I(0x3b1ce)
    TEST_PCADDU12I(0x7a838)
    TEST_PCADDU12I(0x0f444)
    TEST_PCADDU12I(0x3c0f2)
    TEST_PCADDU12I(0xeb3a0)
    TEST_PCADDU12I(0x85f78)
    TEST_PCADDU12I(0x49780)
    TEST_PCADDU12I(0xa5381)
    TEST_PCADDU12I(0x15100)
    TEST_PCADDU12I(0x00000)
###detect exception
    bne s2, zero, inst_error
    nop
###score ++
    addi.w s3, s3, 1
###output (s0<<24)|s3
inst_error:  
    slli.w t1, s0, 24
    NOP4
    or t0, t1, s3 
    NOP4
    st.w t0, s1, 0
    jirl zero, ra, 0
    nop
END(n21_pcaddu12i_test)
